<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>back</button>
    <button>forward</button>
    <button>href</button>
    <script>
        console.log(window);

        window.alert(1)
        console.log(window.prompt('what is your name'));
        console.log(window.confirm('today is Jan 17th,2023'));
        window.setTimeout(()=>{
            console.log('hello');
        },1000)
        window.setInterval(()=>{
            console.log('hello');
        },1000)

        var button=document.getElementsByTagName('button')[0]
        button.addEventListener('click',()=>{
            window.history.back()
        })
        var button=document.getElementsByTagName('button')[1]
        button.addEventListener('click',()=>{
            window.history.forward()
        })

        var button=document.getElementsByTagName('button')[2]
        button.addEventListener('click',()=>{
            window.location.href='https://www.baidu.com'
        })     
    </script>
</body>
</html>